{% extends "layout.html" %}

{% block content %}
<div class="ty-homeblock1 py-5">
    <div class="container pt-lg-5 pt-md-4">
        <div class="row">
            <div class="col-lg-9 most-recent">
                <h3 class="section-title-left">最新文章</h3>
                <div class="list-view ">
                    {% for data in blogs %}
                    <div class="grids5-info img-block-mobile mt-5">
                        <div class="blog-info align-self">
                            <a href="/article/{{ data.id }}" class="blog-desc mt-0">{{ data.title }}</a>
                            <p>{{ data.description }}</p>
                            <div class="author align-items-center mt-3 mb-1">
                                <a href="/category?cid={{ data.cid }}">{{ data.category_name }}</a> &nbsp;&nbsp; <a href="/article/{{ data.id }}">查看</a>
                            </div>
                            <ul class="blog-meta">
                                <li class="meta-item blog-lesson">
                                    <span class="meta-value"> {{ data.created_at.format("%Y-%m-%d") }} </span>
                                </li>
                                <li class="meta-item blog-students">
                                    <span class="meta-value"> {{ data.hits }}浏览</span>
                                </li>
                            </ul>
                        </div>
                        <a href="/article/{{ data.id }}" class="d-block zoom mt-md-0 mt-3">
                            <img src="{{ data.image }}" alt="{{ data.title }}" class="img-fluid radius-image news-image">
                        </a>
                    </div>
                    {% endfor %}
                </div>
                <div class="ty-homeblock1 mt-5">
                    <a href="/category" class="author">查看更多</a>  
                </div>
            </div>
            <div class="col-lg-3 trending mt-lg-0 mt-5 mb-lg-5">
                <div class="pos-sticky">
                    <h3 class="section-title-left">文章分类 </h3>
                    {% for data in categorys %}
                    <div class="grids5-info">
                        <h4>0{{ loop.index }}.</h4>
                        <div class="blog-info">
                            <a href="/category?cid={{ data.id }}" class="blog-desc1"> 
                                <div class="category-item">
                                    <div class="category-img">
                                        <img src="{{ data.image }}" alt="{{ data.name }}" class="img-fluid"/>
                                    </div>
                                    <div class="category-name">
                                        <p>{{ data.name }} </p>
                                        <p class="category-resources">{{ data.num }}文章</p>
                                    </div>
                                </div>
                            </a>
                        </div>
                    </div>
                    {% endfor %}
                </div>
            </div>
        </div>

        <div class="ad-block text-center mt-5">
           <!-- <a href="#url"><img src="/assets/images/ad.gif" class="img-fluid" alt="ad image" /></a>-->
        </div>

    </div>
</div>

{% endblock %}